using System;
using System.Collections.Generic;

using OpenSim.Region.Framework.Scenes;

using OpenMetaverse;

namespace Playtime.RegionModule
{
	public class AvatarConfiguration
	{
		public UUID UUID { get; private set; }
		public ScenePresence Presence { get; private set; }
				
		CollisionHandler mCollisionHandler;
		List<ProfileInstance> mProfileInstances = new List<ProfileInstance>();
		     
		public AvatarConfiguration(ScenePresence presence, IEnumerable<Profile> profileTemplates)
		{
			this.UUID = presence.UUID;
			this.Presence = presence;
			
			foreach(Profile p in profileTemplates)
				mProfileInstances.Add(p.CreateInstance());
		}
		
		public void StartListenForCollisions(ScenePresence presence)
		{
			mCollisionHandler = new CollisionHandler(presence);
			mCollisionHandler.StartListeningForCollisions();
		}
		
		public void StopListenForCollisions()
		{
		}

		public void ExecuteInitializeHook()
		{
			foreach(ProfileInstance p in mProfileInstances)
				p.ExecuteInitializeHook();
		}
	}
}

